using System.Collections.Generic;
using UnityEngine;

public class Tournament : MonoBehaviour
{
	public class TournamentStage
	{
		public TournamentDefinitions.TournamentStageDefinition definition;

		public TournamentDefinitions.Player opponent;

		public bool passed;
	}

	protected List<TournamentStage> stages = new List<TournamentStage>();

	public void StartNewTournament(TournamentDefinitions.TournamentDefinition definition)
	{
		stages.Clear();
		foreach (TournamentDefinitions.TournamentStageDefinition stage in definition.stages)
		{
			TournamentStage item = CreateStage(stage);
			stages.Add(item);
		}
	}

	protected TournamentStage CreateStage(TournamentDefinitions.TournamentStageDefinition stageDefinition)
	{
		TournamentStage tournamentStage = new TournamentStage();
		tournamentStage.definition = stageDefinition;
		List<TournamentDefinitions.Player> players = ScriptableObjectSingleton<TournamentDefinitions>.instance.players;
		PlayerStats playerStats = GGPlayerSettings.instance.statsManager.playerStats;
		foreach (TournamentDefinitions.Player item in players)
		{
			foreach (TournamentDefinitions.Skill skil in item.skils)
			{
				float num = playerStats.GetSkillValue(skil.skillTypeIndex) - skil.skillValue;
			}
		}
		return tournamentStage;
	}
}
